Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@cspell/cspell-types
Advanced tools
@cspell/cspell-types is a TypeScript library that provides type definitions for the CSpell spelling checker configuration. It allows developers to define and manage spelling configurations programmatically, ensuring that their spelling rules are consistent and easily maintainable.
Define CSpell Configuration
This feature allows you to define a CSpell configuration using TypeScript. You can specify the language, custom words, paths to ignore, and dictionaries to use.
{
"import { CSpellUserSettings } from '@cspell/cspell-types';
const config: CSpellUserSettings = {
language: 'en',
words: ['typescript', 'npm'],
ignorePaths: ['node_modules', 'dist'],
dictionaries: ['softwareTerms']
};
console.log(config);"
}
Extend Existing Configuration
This feature demonstrates how to extend an existing CSpell configuration. You can merge configurations to add new words or ignore paths while keeping the base configuration intact.
{
"import { CSpellUserSettings } from '@cspell/cspell-types';
const baseConfig: CSpellUserSettings = {
language: 'en',
words: ['typescript']
};
const extendedConfig: CSpellUserSettings = {
...baseConfig,
words: [...baseConfig.words, 'npm'],
ignorePaths: ['node_modules']
};
console.log(extendedConfig);"
}
Validate Configuration
This feature allows you to validate a CSpell configuration to ensure it meets the required schema. The `validateConfig` function checks the configuration and returns any validation errors.
{
"import { CSpellUserSettings, validateConfig } from '@cspell/cspell-types';
const config: CSpellUserSettings = {
language: 'en',
words: ['typescript', 'npm'],
ignorePaths: ['node_modules', 'dist'],
dictionaries: ['softwareTerms']
};
const validationResult = validateConfig(config);
console.log(validationResult);"
}
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. It helps developers maintain code quality and consistency. Unlike @cspell/cspell-types, which focuses on spelling, ESLint focuses on code linting and style enforcement.
Stylelint is a linter for CSS and other style sheet languages. It helps developers avoid errors and enforce consistent conventions in their styles. While @cspell/cspell-types is for spelling configurations, Stylelint is specifically for style sheet linting.
Prettier is an opinionated code formatter that supports many languages. It enforces a consistent style by parsing your code and re-printing it with its own rules. Unlike @cspell/cspell-types, which is for spelling configurations, Prettier focuses on code formatting.
Contains cspell types and json-schema.
This package contains no dependencies to avoid any security issues.
Available as part of the Tidelift Subscription.
The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. Learn more.
npm i -SD @cspell/cspell-types
Can be use to make writing cspell.config.js
files easier.
'use strict';
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
const cspell = {
description: 'cspell.config.js file in samples/js-config',
languageSettings: [
{
languageId: 'cpp',
allowCompoundWords: false,
patterns: [
{
name: 'pound-includes',
pattern: /^\s*#include.*/g,
},
],
ignoreRegExpList: ['pound-includes'],
},
],
dictionaryDefinitions: [
{
name: 'custom-words',
path: './custom-words.txt',
},
],
dictionaries: ['custom-words'],
};
module.exports = cspell;
CSpellSettings
alias CSpellUserSettings
is the formal definition of the configuration that controls the spell checker.
Available as part of the Tidelift Subscription.
The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. Learn more.
Brought to you by Street Side Software
FAQs
Types for cspell and cspell-lib
The npm package @cspell/cspell-types receives a total of 458,720 weekly downloads. As such, @cspell/cspell-types popularity was classified as popular.
We found that @cspell/cspell-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.